dojo.provide('ph.osc.Sender')

dojo.require('ph.event.Event');
ph.require('com.illposed.osc.OSCPortOut');
ph.require('com.illposed.osc.OSCMessage');

dojo.declare('ph.osc.Sender', null, {
  constructor: function(host, port) {
    this._port = new com.illposed.osc.OSCPortOut(java.net.InetAddress.getByName(host), port);
  },
  
  send: function(topic) {
    var message = new com.illposed.osc.OSCMessage(topic);
    for (var i = 1; i < arguments.length; i++) message.addArgument(arguments[i]);
    
    this._port.send(message);
  }
});